﻿@using CaptchaMvc.HtmlHelpers;
@model IEnumerable<WebDKMH.Models.MyViewModel>
@{
    ViewBag.Title = "ChonLaiGV";
    Layout = "~/Views/Shared/Trangchu.cshtml";
}
@if (Session["LoginUserID"] == null)
{
    Response.Redirect("~/User/Dangnhap");
}
@{
    DateTime date = DateTime.Now;
    int snamhoc2 = date.Year;
    int snamhoc1 = snamhoc2 - 1;
    string snamhoc = "";
    string shocky = "";
    int sthang = date.Month;
    if (sthang >= 4 && sthang <= 7)
    {
        snamhoc = Convert.ToString(snamhoc2).Trim();
        shocky = "1";
    }
    else
    {
        snamhoc = Convert.ToString(snamhoc1).Trim();
        shocky = "2";
    }
    int snamhoc3 = Convert.ToInt32(snamhoc) + 1;
}
@*<div class="Content-midle-Top-Ten"><h4> ► Đăng Ký</h4></div>*@

<div class="Main-Content-1">
    <div class="Main-Content-1-Tieude">
        <img src="~/Images/icon_dangky.png" />
        <ul>
            <li>
                <h2>ĐĂNG KÍ MÔN HỌC</h2>
            </li>
        </ul>
    </div>
    <div class="Main-Content-1-Noidung">
        <p>
            Lớp: <b>@Session["malop"]</b> - Năm học: <b>@snamhoc-@snamhoc3</b> - Học kỳ: <b>@shocky</b>
        </p>
        @using (Html.BeginForm())
            {
            <table class="Table-1" border="1" cellspacing="0" style="border: 1px groove #0976f5; width: 750px; margin: auto; ">
                <tr style=" color: #ffffff; background: #4395f5;">
                    <th>STT </th>
                    <th>Mã Môn Học</th>
                    <th> Tên Môn Học</th>
                    <th>Số TC</th>
                    <th style="width:200px"> Chọn GV Dạy (Click vào tên giảng viên để biết lý lịch khoa học)</th>
                    <th>GV đã chọn</th>
                </tr>
                @{
                int i = 0;
                string gvchon = "gvchon";
                string dautru = "-";
                }

                @foreach (var item in Model)
            {
                i = i + 1;
                    <tr style="color: #0c1574; border-collapse: collapse;">
                        <td>@i</td>
                        <td>@Html.DisplayFor(modelItem=>item.mamh)</td>
                        <td>@Html.DisplayFor(modelItem => item.tenmh) </td>
                        <td>@Html.DisplayFor(modelItem => item.sotc)</td>
                        <td>

                            @if (item.magv1 != null && item.magv1.Trim() != "")
                        {<input  type="radio" name=@gvchon@i value="@item.magv1.Trim()@dautru@item.mamh.Trim()" /><a class="cgv" style="text-decoration:none" href="http://www.qnamuni.edu.vn/viewLLKH.asp?MaGV=@item.magv1" target="_blank">@item.tengv1</a><br />}
                            @if (item.magv2 != null && item.magv2.Trim() != "")
                        {<input  type="radio" name=@gvchon@i value="@item.magv2.Trim()@dautru@item.mamh.Trim()" /><a class="cgv" style="text-decoration:none" href="http://www.qnamuni.edu.vn/viewLLKH.asp?MaGV=@item.magv1" target="_blank">@item.tengv2</a><br />}
                            @if (item.magv3 != null && item.magv3.Trim() != "")
                        {<input  type="radio" name=@gvchon@i value="@item.magv3.Trim()@dautru@item.mamh.Trim()" /><a class="cgv" style="text-decoration:none" href="http://www.qnamuni.edu.vn/viewLLKH.asp?MaGV=@item.magv1" target="_blank">@item.tengv3</a><br />}

                        </td>
                        <td>@item.tengvchon</td>
                    </tr>
            }
            </table>
            <input type="hidden" name="soluongmh" value="@i" />
        <table style="margin-top:30px">
            <tr>
                <td>Mã xác nhận:</td>
                <td><input style="float:left" id="" type="text" /></td>
                <td><input style=" width: 80px; height: 30px; float: left; margin-left:38px; margin-top: -5px;" id="submit" type="submit" value="Xác nhận" /></td>
                <td><input style=" width: 80px; height: 30px; float: left; margin-left:38px; margin-top: -5px;" id="Cancel" type="reset" value="Hủy bỏ" /></td>
            </tr>
        </table>
           
        }
        </div>
    </div>



@*<table>
        @using (Html.BeginForm())
    {
            <tr>
                <td style="padding-left:293px">
                    @Html.Captcha("thay đổi mã", "Mã xác nhận ", 5, "Is required field."@*,true*@)
@*<h1 style="color: green">@TempData["Message"]</h1>*@
@*<h5 style="color: blue">@TempData["ErrorMessage"]</h5>
<input style=" width: 80px; height: 30px; float: left; margin-top: 5px;" id="Ok" type="submit" value="Xác nhận" />
<input style=" width: 80px; height: 30px; float: left; margin-left:38px; margin-top:5px;" id="Cancel" type="reset" value="Hủy bỏ" />
                        </td>
                    </tr>
            }
            </table>*@